const state = {
    // 自己创建的钱包
    fomoInfo: {},
    // 弹窗
    fomotip: {
        id: "",
        explainShow: false
    },
    lottery_list: {
        id: '',
        listShow: false
    },
    WeekWinnerList: [],
    LastWinnerList: []

    // id
    // 0:奖池文档
    // 1:准备金文档
    // 2:活期文档
    // 3:定期文档
    // 4:周抽奖池
    // 5:注册须知
    // 6:预计产矿值
    // 7:邀请码
};


const actions = {
    aFomoInfo({commit}, {
        name = "", pID = "", laffCount = "", laff = "",
        bankPot = "", bankSurplus = "", bID = "", leaveDT = "", leaveHT = "", minInvest_ = "", expect = "",
        investD = "", withdrawD = "", awardLaffD = "", investH = "", withdrawH = "", awardLaffH = "",
        weekPot = "", wID = "", weekEnd = "",
        lastPot = "", lID = "", lastEnd = "",activated = ""
    }) {
        commit('mFomoInfo', {
            name, pID, laffCount, laff,
            bankPot, bankSurplus, bID, leaveDT, leaveHT, minInvest_, expect,
            investD, withdrawD, awardLaffD, investH, withdrawH, awardLaffH,
            weekPot, wID, weekEnd,
            lastPot, lID, lastEnd,activated
        })
    },
    aShowTip({commit}, {id = '', explainShow = ""}) {
        commit('mShowTip', {id, explainShow})
    },
    aShowList({commit}, listShow) {
        commit('mShowList', listShow)
    },
    aWeekWinnerList({commit}, obj) {
        commit('mWeekWinnerList', obj)
    },
    aLastWinnerList({commit}, obj) {
        commit('mLastWinnerList', obj)
    }
};

const mutations = {
    mFomoInfo(state, {
        name, pID, laffCount, laff,
        bankPot, bankSurplus, bID, leaveDT, leaveHT, minInvest_, expect,
        investD, withdrawD, awardLaffD, investH, withdrawH, awardLaffH,
        weekPot, wID, weekEnd,
        lastPot, lID, lastEnd,activated
    }) {
        state.fomoInfo = {
            name, pID, laffCount, laff,
            bankPot, bankSurplus, bID, leaveDT, leaveHT, minInvest_, expect,
            investD, withdrawD, awardLaffD, investH, withdrawH, awardLaffH,
            weekPot, wID, weekEnd,
            lastPot, lID, lastEnd,activated
        };
    },
    mShowTip(state, {id, explainShow}) {
        id === '' && (id = state.fomotip.id);
        explainShow === '' && (explainShow = state.fomotip.explainShow);

        state.fomotip = {id, explainShow};
    },
    mShowList(state, listShow) {
        state.lottery_list = listShow
    },
    mWeekWinnerList(state, obj) {
        state.WeekWinnerList = obj
    },
    mLastWinnerList(state, obj) {
        state.LastWinnerList = obj
    }
};

export default {
    namespaced: true,
    state,
    actions,
    mutations,
}